1. Field of the Invention
The present invention relates to a static image compressing process, and to an image processing device and method for performing a user-specified process on the image and then compressing the image.
2. Description of the Related Art
Recently, a JPEG (joint photographic experts group) baseline compressing system has been popularly used when a static image is compressed in an image processing system for newspapers and printed matters using common photo-retouching software, etc. The JPEG baseline compressing process is a compressing method prescribed by the JPEG, that is, a committee for the standardization in encoding static color images in the CCITT (International Telegraph and Telephone Consultative Committee) Group VIII.
FIG. 1 shows the JPEG baseline compressing process. In the JPEG baseline compressing process, an image to be compressed is divided into basic 8.times.8-picture element blocks and then compressed. A picture element value P.sub.x,y is converted into a DCT coefficient S.sub.u,v in a DCT transformation (discrete cosine transformation) in basic block units. The basic equation of the DCT transformation is as follows. ##EQU1## where x and y indicate the positions of the picture element blocks on the X Y plain, and constants C.sub.u, C.sub.v, and L.sub.s are defined by the following equation. ##EQU2##
The DCT coefficient S.sub.u,v is quantized using a quantization table Q.sub.u,v and is converted into a quantized DCT coefficient r.sub.u,v. The r.sub.u,v is basically obtained by the following equation. EQU r.sub.u,v =round (S.sub.u,v /Q.sub.u,v) (2)
In equation (2), round (X) is a function replacing the real number X with an integer closest to the real number X. The value r.sub.u,v is encoded, and then transmitted as encoded data through a transmission line such as a circuit, etc.
FIG. 2 shows the reconstruction process by the system for receiving the encoded data of the image. The encoded data is decoded into a quantized DCT coefficient r.sub.u,v and then inversely quantized using the quantization table Q.sub.u,v used in the compressing process. Thus, the obtained DCT coefficient S'.sub.u,v is converted into the picture element value P'.sub.x,y in basic blocks in the inverse DCT transformation, and the image can be enlarged using the P.sub.x,y.
Since the rounding process is performed on S.sub.u,v /Q.sub.u,v in the quantization process in the JPEG baseline compressing process, a DCT coefficient S.sub.u,v before the quantization does not normally match a DCT coefficient S'.sub.u,v after the inverse quantization. Therefore, the picture element value PXY before the DCT transformation does not match the picture element value P'.sub.x,y after the inverse DCT transformation. However, when the data P'.sub.x,y obtained as a result of once enlarging a compressed image is compressed again, no rounding process is performed in the quantization because the DCT coefficient obtained by DCT transforming P'.sub.x,y under the same conditions is represented as being rounded and therefore is necessarily an integer.
However, in the image processing system for performing the conventional JPEG baseline compressing process, the quality of the image is gradually deteriorated if the JPEG enlarging process, image process, and JPEG compressing process are repeatedly performed.
When the compressing and enlarging processes are repeated under the same conditions, the original image does not become different from the enlarged image through the deterioration of the data, that is, through the rounding process. However, if the compressing process is performed after the segmenting process of the trimming process, etc., the configuration of the basic blocks (for compression) is destroyed. In this case, since new basic blocks are established according to the trimming box, fragments are newly generated through the quantization by equation (2), thereby degenerating the data. Thus, when a trimming process is performed in the conventional image process, the image is segmented by a trimming box of the position and size specified by the operator. Therefore, the basic block for compression has been changed with the quality of the image deteriorated.